# $Id$
# Maintainer:
# Contributor: Andrea Scarpino <andrea@archlinux.org>
# Contributor: PedsXing <pedsxing at gmx dot net>

pkgname=vc
pkgver=1.3.2
pkgrel=2
pkgdesc="A library to ease explicit vectorization of C++ code"
url='https://github.com/VcDevel/Vc'
arch=(i686 x86_64)
license=(LGPL3)
makedepends=(cmake)
source=("https://github.com/VcDevel/Vc/releases/download/$pkgver/Vc-$pkgver.tar.gz")
sha256sums=('3eae2b05836a1a57545e624b38345ad33cfde23d527e12575edde784c4c330ee')

prepare() {
  mkdir -p build

# Fix i686 build
  cd Vc-$pkgver
  sed -e 's:(x86|AMD64):(i686|x86|AMD64):g' -i CMakeLists.txt
}

build() {
  cd build
  cmake ../Vc-$pkgver \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=Release \
    -DTARGET_ARCHITECTURE=generic
  make
}

package() {
  cd build
  make DESTDIR="$pkgdir" install
}
